(function($, window) {
	var baseRequest = window.baseRequest;
	var appConfig = window.appConfig;
	var commonTool = window.commonTool;
	var dataManager = window.dataManager;
	var baseUrl = appConfig.v3ServiceUrl + '/apmonitor';
	
	var v3Apmonitor = window.v3Apmonitor = {};

	
	
	//Add by wangyu
	
	var apListOnline = baseUrl + '/app/aplist_online?';
	v3Apmonitor.getApListOnline = function(devSN, startNum, callback){
		baseRequest.commonGet(apListOnline + $.param({
			devSN : devSN,
			startNum : startNum
		}), 10000, function(code, data){
			if(code === 0){
				if(data == -1 || data.errcode) {
					callback(1);
				} else {
					callback(0, data);
				}
			}
			if(code === 1 || code ===2){
				return callback(2);
			}
		})
	}
	
	var apInfoByApMac = baseUrl + '/getapinfobyapmac?';
	v3Apmonitor.getApInfoByApMac = function(devSN, Mac, callback){
		baseRequest.commonGet(apInfoByApMac + $.param({
			devSN: devSN,
			apMAC: Mac
		}), 10000, function(code, data){
			if(code === 0){
				if(data == -1 || data.code === -1) {
					callback(1);
				} else {
					callback(0, data.data);
				}
			}
			if(code === 1 || code ===2){
				return callback(2);
			}
		})
	}
	
	var clientThroughPut = baseUrl + '/getapinfobytotalflowarea?';
	v3Apmonitor.getClientThroughPut =function(devSN, mark, callback){
		baseRequest.commonGet(clientThroughPut + $.param({
			devSN: devSN,
			mark: mark
		}), 10000, function(code, data){
			if(code === 0){
				if(data == -1) {
					callback(1);
				} else {
					callback(0, data.apList);
				}
			}
			if(code === 1 || code ===2){
				return callback(2);
			}
		})
	}
	
	var apListOffline = baseUrl + '/app/aplist_offline?';
	v3Apmonitor.getApListOffline = function(devSN, startNum, callback){
		baseRequest.commonGet(apListOffline + $.param({
			devSN : devSN,
			startNum : startNum
		}), 10000, function(code, data){
			if(code === 0){
				if(data == -1 || data.errcode) {
					callback(1);
				} else {
					callback(0, data);
				}
			}
			if(code === 1 || code ===2){
				return callback(2);
			}
		})
	}
	
	var kpifind24G = baseUrl + '/getapnumberbychlbusy';
	v3Apmonitor.getkpifind24G = function(devSN, callback){
		baseRequest.commonPost(kpifind24G, {
			"devSN": devSN,
			"channelBusy": 80
		}, 10000, function(code, data){
			if(code === 0){
				if(data == -1 || data.message == 'fail') {
					callback(1);
				} else {
					callback(0, data.data);
				}
			}
			if(code === 1 || code ===2){
				return callback(2);
			}
		})
	}
	
	var kpiUse24G = baseUrl + '/getapinfobychlbusy';
	v3Apmonitor.getkpiUse24G = function(devSN, skipnum, callback){
		baseRequest.commonPost(kpiUse24G, {
			"devSN":devSN,
			"channelBusy": 80,
			"skipnum": skipnum,
			"limitnum": 10,
			"radioType": "2.4G"
		}, 10000, function(code, data){
			if(code === 0){
				if(data == -1 || data.message == 'fail') {
					callback(1);
				} else {
					callback(0, data.data);
				}
			}
			if(code === 1 || code ===2){
				return callback(2);
			}
		})
	}
	
	var kpiUse5G = baseUrl + '/getapinfobychlbusy';
	v3Apmonitor.getkpiUse5G = function(devSN, skipnum, callback){
		baseRequest.commonPost(kpiUse5G, {
			"devSN":devSN,
			"channelBusy": 80,
			"skipnum": skipnum,
			"limitnum": 10,
			"radioType": "5G"
		}, 10000, function(code, data){
			if(code === 0){
				if(data == -1 || data.message == 'fail') {
					callback(1);
				} else {
					callback(0, data.data);
				}
			}
			if(code === 1 || code ===2){
				return callback(2);
			}
		})
	}
	
	var apList = baseUrl + '/app/aplist?';
	v3Apmonitor.getApList = function(devSN, startNum, callback){
		baseRequest.commonGet(apList + $.param({
			devSN : devSN,
			startNum : startNum
		}), 10000, function(code, data){
			if(code === 0){
				if(data == -1 || data.errcode) {
					callback(1);
				} else {
					callback(0, data);
				}
			}
			if(code === 1 || code ===2){
				return callback(2);
			}
		})
	}
	
//	var apListInfo = baseUrl + '/app/apinfo?';
//	v3Apmonitor.getApListInfo = function(devSN, apSN, callback){
//		baseRequest.commonGet(apListInfo + $.param({
//			devSN : devSN,
//			apSN : apSN
//		}), 10000, function(code, data){
//			if(code === 0){
//				if(data == -1 || data.errcode) {
//					callback(1);
//				} else {
//					callback(0, data.apInfo);
//				}
//			}
//			if(code === 1 || code ===2){
//				return callback(2);
//			}
//		})
//	}
	
	var searchInfo = baseUrl + '/app/aplist_page?';
	v3Apmonitor.getSearchInfo = function(devSN, skipnum, checkdata, callback){
		baseRequest.commonPost(searchInfo + $.param({
			devSN : devSN,
			skipnum : skipnum,
			limitnum : 10
		}), checkdata, 10000, function(code, data){
			if(code === 0){
				if(data == -1 || data.errcode) {
					callback(1);
				} else {
					callback(0, data);
				}
			}
			if(code === 1 || code ===2){
				return callback(2);
			}
		})
	}
	
	var apCountByMethod = baseUrl + '/getApCountByMethodForApList?';
	v3Apmonitor.getApCountByMethod = function(devSN, CreateMethod, skipnum, checkdata, callback){
		baseRequest.commonPost(apCountByMethod + $.param({
			devSN: devSN,
			skipnum: skipnum,
			limitnum: 10,
			CreateMethod: CreateMethod
		}), checkdata, 10000, function(code, data){
			if(code === 0){
				if(data == -1 || data.errcode) {
					callback(1);
				} else {
					callback(0, data);
				}
			}
			if(code === 1 || code ===2){
				return callback(2);
			}
		})
	}
	
	var clientNum = baseUrl + '/getApListByClientNum?';
	v3Apmonitor.getClientNum = function(devSN, clientNumLeft, clientNumRight, skipnum, checkdata, callback){
		baseRequest.commonPost(clientNum + $.param({
			devSN : devSN,
			skipnum : skipnum,
			limitnum : 10,
			clientNumLeft : clientNumLeft,
			clientNumRight : clientNumRight
		}), checkdata, 10000, function(code, data){
			if(code === 0){
				if(data == -1 || data.errcode) {
					callback(1);
				} else {
					callback(0, data);
				}
			}
			if(code === 1 || code ===2){
				return callback(2);
			}
		})
	}
	
	var kpistanum = baseUrl + '/getApCountByStatus?';
	v3Apmonitor.getKpistanumTwo = function(devSN, callback) {
		baseRequest.commonGet(kpistanum + $.param({
			devSN: devSN
		}), 10000, function(code, data) {
			if(code === 2 || code === 1) {
				return callback(2);
			}
			if(code === 0) {
				if(data == -1 || data.errcode) {
					callback(1);
				} else {
					callback(0, data);
				}
			}
		});
	}
	
	var putTop5 = baseUrl + '/gettop20apcountbytotalflow?';
	v3Apmonitor.getPutTop5 = function(devSN, callback){
		baseRequest.commonGet(putTop5 + $.param({
			devSN: devSN
		}), 10000, function(code, data){
			if(code === 2 || code === 1) {
				return callback(2);
			}
			if(code === 0) {
				if(data == -1 || data.errcode) {
					callback(1);
				} else {
					callback(0, data.Aplist);
				}
			}
		});
	}
	
	var totalFlower = baseUrl + '/getapcountbytotalflowarea?';
	v3Apmonitor.getTotalFlower = function(devSN, callback){
		baseRequest.commonGet(totalFlower + $.param({
			devSN: devSN
		}), 10000, function(code, data){
			if(code === 2 || code === 1) {
				return callback(2);
			}
			if(code === 0) {
				if(data == -1 || data.errcode) {
					callback(1);
				} else {
					callback(0, data.ApCount);
				}
			}
		});
	}

	var kpipacketLost = baseUrl + '/app/aplist_fuzzy?';
	v3Apmonitor.getKpipacketLost = function(devSN, callback) {
		baseRequest.commonPost(kpipacketLost + $.param({
			devSN: devSN,
			skipnum: 0,
			limitnum: 1
		}), {
			"findoption": {
				"packLostRatio": {
					"min": 0.1,
					"max": -1
				}
			},
			"sortoption": {}
		}, 10000, function(code, data) {
			if(code === 2 || code === 1) {
				return callback(2);
			}
			if(code === 0) {
				if(data == -1 || data.errcode) {
					callback(1);
				} else {
					callback(0, data);
				}
			}
		})
	}
	
	var kpiLost = baseUrl + '/app/aplist_fuzzy?';
	v3Apmonitor.getKpiLost = function(devSN, skipnum, callback) {
		baseRequest.commonPost(kpiLost + $.param({
			devSN: devSN,
			skipnum: skipnum,
			limitnum: 10
		}), {
			"findoption": {
				"packLostRatio": {
					"min": 0.1,
					"max": -1
				}
			},
			"sortoption": {}
		}, 10000, function(code, data) {
			if(code === 2 || code === 1) {
				return callback(2);
			}
			if(code === 0) {
				if(data == -1 || data.errcode) {
					callback(1);
				} else {
					callback(0, data);
				}
			}
		})
	}
	
	var getkpicpu = baseUrl + '/app/aplist_fuzzy?';
	v3Apmonitor.getkpicpu = function(devSN, callback) {
		baseRequest.commonPost(getkpicpu + $.param({
			devSN: devSN,
			skipnum: 0,
			limitnum: 1
		}), {
			"findoption": {
				"cpuRatio": {
					"min": 91,
					"max": -1
				}
			},
			"sortoption": {}
		}, 10000, function(code, data) {
			if(code === 2 || code === 1) {
				return callback(2);
			}
			if(code === 0) {
				if(data == -1 || data.errcode) {
					callback(1);
				} else {
					callback(0, data);
				}
			}
		})
	}
	
	var kpiLongpacketLost = baseUrl + '/app/aplist_fuzzy?';
	v3Apmonitor.getLongkpicpu = function(devSN, skipnum, callback) {
		baseRequest.commonPost(kpiLongpacketLost + $.param({
			devSN: devSN,
			skipnum: skipnum,
			limitnum: 10
		}), {
			"findoption": {
				"cpuRatio": {
					"min": 91,
					"max": -1
				}
			},
			"sortoption": {}
		}, 10000, function(code, data) {
			if(code === 2 || code === 1) {
				return callback(2)
			}
			if(code === 0) {
				if(data == -1 || data.errcode) {
					callback(1);
				} else {
					callback(0, data);
				}
			}
		})
	}
	
	var getkpimemory = baseUrl + '/app/aplist_fuzzy?';
	v3Apmonitor.getkpimemory = function(devSN, callback) {
		baseRequest.commonPost(getkpimemory + $.param({
			devSN: devSN,
			skipnum: 0,
			limitnum: 1
		}), {
			"findoption": {
				"memoryRatio": {
					"min": 91,
					"max": -1
				}
			},
			"sortoption": {}
		}, 10000, function(code, data) {
			if(code === 2 || code === 1) {
				return callback(2);
			}
			if(code === 0) {
				if(data == -1 || data.errcode) {
					callback(1);
				} else {
					callback(0, data);
				}
			}
		})
	}
	
	var getMindkpiMemory = baseUrl + '/app/aplist_fuzzy?';
	v3Apmonitor.getMindkpimemory = function(devSN, skipnum, callback) {
		baseRequest.commonPost(getMindkpiMemory + $.param({
			devSN: devSN,
			skipnum: skipnum,
			limitnum: 10
		}), {
			"findoption": {
				"memoryRatio": {
					"min": 91,
					"max": -1
				}
			},
			"sortoption": {}
		}, 10000, function(code, data) {
			if(code === 2 || code === 1) {
				return callback(2);
			}
			if(code === 0) {
				if(data == -1 || data.errcode) {
					callback(1);
				} else {
					callback(0, data);
				}
			}
		})
	}
	
	var kpiclient5G = baseUrl + '/aplist_5Gclient?';
	v3Apmonitor.getkpiclient5G = function(devSN, callback){
		baseRequest.commonGet(kpiclient5G + $.param({
			devSN : devSN,
			objNum :51
		}), 10000, function(code, data){
			if(code === 2 || code === 1) {
				return callback(2);
			}
			if(code === 0) {
				if(data == -1 || data.errcode) {
					callback(1);
				} else {
					callback(0, data);
				}
			}
		})
	}
	
	// end
	
	var getApCountByStatus = baseUrl + '/getApCountByStatus?';
	v3Apmonitor.getApCountByStatus = function(devSN, callback){
		baseRequest.commonGet(getApCountByStatus + $.param({
			devSN : devSN
		}), 10000, function(code, data){
			if(code === 2 || code === 1) {
				return callback(2);
			}
			if(code === 0) {
				if(data == -1 || data.errcode) {
					callback(1);
				} else {
					callback(0, data);
				}
			}
		})
	}

	//add by ding
	
	//apStatus= "online","offline"
	v3Apmonitor.getApCountOfApModelByApStatus = function(devSN,apStatus,callback){
		var getApCountOfApModelByApStatusUrl = "";
		if(apStatus === "online"){
			getApCountOfApModelByApStatusUrl = baseUrl + '/getOnlineApCountByModel?';
		}else{
			getApCountOfApModelByApStatusUrl = baseUrl + '/getOfflineApCountByModel?';
		}
		baseRequest.commonGet(getApCountOfApModelByApStatusUrl + $.param({
			devSN : devSN
		}), function(code, data){
			if(code === 2 || code === 1) {
				return callback(2);
			}
			if(code === 0) {
				if(data == -1 || data.errcode) {
					callback(1);
				} else {
					callback(0, data);
				}
			}
		});
	}
	
	//statisticsMode = "cpu" "memery"
	v3Apmonitor.getApStatisticsByMode = function(devSN,statisticsMode,callback){
		var getApStatisticsByModeUrl = "";
		if(statisticsMode === "cpu"){
			getApStatisticsByModeUrl = baseUrl + "/statistics_byapcpuratio?";
		}else{
			getApStatisticsByModeUrl = baseUrl + "/statistics_byapmemratio?";
		}
		baseRequest.commonGet(getApStatisticsByModeUrl + $.param({
			devSN : devSN
		}), function(code, data){
			if(code === 2 || code === 1) {
				return callback(2);
			}
			if(code === 0) {
				if(data == -1 || data.errcode) {
					callback(1);
				} else {
					callback(0, data);
				}
			}
		});
	}
	
	var getApCountByApCreateMethodUrl = baseUrl + "/getApCountByMethod?";
	v3Apmonitor.getApCountByApCreateMethod = function(devSN,callback){
		// {"apList":[{"CreateMethod":1,"ApCount":16},{"CreateMethod":2,"ApCount":0},{"CreateMethod":3,"ApCount":23},{"CreateMethod":4,"ApCount":0}]}
		baseRequest.commonGet(getApCountByApCreateMethodUrl + $.param({
			devSN : devSN
		}), function(code, data){
			if(code === 2 || code === 1) {
				return callback(2);
			}
			if(code === 0) {
				if(data == -1 || data.errcode) {
					callback(1);
				} else {
					callback(0, data);
				}
			}
		});
	}
	
	//apmonitor/app/aplist?devSN=' + AcSN + '&startNum=
	var getApListUrl = baseUrl + '/app/aplist?';
	v3Apmonitor.getApList = function(devSN,startNum,callback){
		baseRequest.commonGet(getApListUrl + $.param({
			devSN : devSN,
			startNum : startNum
		}), function(code, data){
			if(code === 2 || code === 1) {
				return callback(2);
			}
			if(code === 0) {
				if(data == -1 || data.errcode) {
					callback(1);
				} else {
					callback(0, data);
				}
			}
			if(code === 1 || code ===2){
				return callback(2);
			}
		})
	}
	
	var apListOffline = baseUrl + '/app/aplist_offline?';
	v3Apmonitor.getApListOffline = function(devSN, startNum, callback){
		baseRequest.commonGet(apListOffline + $.param({
			devSN : devSN,
			startNum : startNum
		}), 10000, function(code, data){
			if(code === 0){
				if(data == -1 || data.errcode) {
					callback(1);
				} else {
					callback(0, data);
				}
			}
			if(code === 1 || code ===2){
				return callback(2);
			}
		})
	}
	
	var apList = baseUrl + '/app/aplist?';
	v3Apmonitor.getApList = function(devSN, startNum, callback){
		baseRequest.commonGet(apList + $.param({
			devSN : devSN,
			startNum : startNum
		}), 10000, function(code, data){
			if(code === 0){
				if(data == -1 || data.errcode) {
					callback(1);
				} else {
					callback(0, data);
				}
			}
			if(code === 1 || code ===2){
				return callback(2);
			}
		})
	}
	
	var apListInfo = baseUrl + '/app/apinfo?';
	v3Apmonitor.getApListInfo = function(devSN, apSN, callback){
		baseRequest.commonGet(apListInfo + $.param({
			devSN : devSN,
			apSN : apSN
		}), 10000, function(code, data){
			if(code === 0){
				if(data == -1 || data.errcode) {
					callback(1);
				} else {
					callback(0, data.apInfo);
				}
			}
			if(code === 1 || code ===2){
				return callback(2);
			}
		})
	}
	
	var searchInfo = baseUrl + '/app/aplist_page?';
	v3Apmonitor.getSearchInfo = function(devSN, skipnum, checkdata, callback){
		baseRequest.commonPost(searchInfo + $.param({
			devSN : devSN,
			skipnum : skipnum,
			limitnum : 10
		}), checkdata, 10000, function(code, data){
			if(code === 0){
				if(data == -1 || data.errcode) {
					callback(1);
				} else {
					callback(0, data);
				}
			}
			if(code === 1 || code ===2){
				return callback(2);
			}
		})
	}
	
	var clientNum = baseUrl + '/getApListByClientNum?';
	v3Apmonitor.getClientNum = function(devSN, clientNumLeft, clientNumRight, skipnum, checkdata, callback){
		baseRequest.commonPost(clientNum + $.param({
			devSN : devSN,
			skipnum : skipnum,
			limitnum : 10,
			clientNumLeft : clientNumLeft,
			clientNumRight : clientNumRight
		}), checkdata, 10000, function(code, data){
			if(code === 0){
				if(data == -1 || data.errcode) {
					callback(1);
				} else {
					callback(0, data);
				}
			}
			if(code === 1 || code ===2){
				return callback(2);
			}
		})
	}
	
	var kpistanum = baseUrl + '/getApCountByStatus?';
	v3Apmonitor.getKpistanumTwo = function(devSN, callback) {
		baseRequest.commonGet(kpistanum + $.param({
			devSN: devSN
		}), 10000, function(code, data) {
			if(code === 2 || code === 1) {
				return callback(2);
			}
			if(code === 0) {
				if(data == -1 || data.errcode) {
					callback(1);
				} else {
					callback(0, data);
				}
			}
		});
	}

	var kpipacketLost = baseUrl + '/app/aplist_fuzzy?';
	v3Apmonitor.getKpipacketLost = function(devSN, callback) {
		baseRequest.commonPost(kpipacketLost + $.param({
			devSN: devSN,
			skipnum: 0,
			limitnum: 1
		}), {
			"findoption": {
				"packLostRatio": {
					"min": 0.1,
					"max": -1
				}
			},
			"sortoption": {}
		}, 10000, function(code, data) {
			if(code === 2 || code === 1) {
				return callback(2);
			}
			if(code === 0) {
				if(data == -1 || data.errcode) {
					callback(1);
				} else {
					callback(0, data);
				}
			}
		})
	}
	
	var kpiLost = baseUrl + '/app/aplist_fuzzy?';
	v3Apmonitor.getKpiLost = function(devSN, skipnum, callback) {
		baseRequest.commonPost(kpiLost + $.param({
			devSN: devSN,
			skipnum: skipnum,
			limitnum: 10
		}), {
			"findoption": {
				"packLostRatio": {
					"min": 0.1,
					"max": -1
				}
			},
			"sortoption": {}
		}, 10000, function(code, data) {
			if(code === 2 || code === 1) {
				return callback(2);
			}
			if(code === 0) {
				if(data == -1 || data.errcode) {
					callback(1);
				} else {
					callback(0, data);
				}
			}
		})
	}
	
	var getkpicpu = baseUrl + '/app/aplist_fuzzy?';
	v3Apmonitor.getkpicpu = function(devSN, callback) {
		baseRequest.commonPost(getkpicpu + $.param({
			devSN: devSN,
			skipnum: 0,
			limitnum: 1
		}), {
			"findoption": {
				"cpuRatio": {
					"min": 91,
					"max": -1
				}
			},
			"sortoption": {}
		}, 10000, function(code, data) {
			if(code === 2 || code === 1) {
				return callback(2);
			}
			if(code === 0) {
				if(data == -1 || data.errcode) {
					callback(1);
				} else {
					callback(0, data);
				}
			}
		})
	}
	
	var kpiLongpacketLost = baseUrl + '/app/aplist_fuzzy?';
	v3Apmonitor.getLongkpicpu = function(devSN, skipnum, callback) {
		baseRequest.commonPost(kpiLongpacketLost + $.param({
			devSN: devSN,
			skipnum: skipnum,
			limitnum: 10
		}), {
			"findoption": {
				"cpuRatio": {
					"min": 91,
					"max": -1
				}
			},
			"sortoption": {}
		}, 10000, function(code, data) {
			if(code === 2 || code === 1) {
				return callback(2)
			}
			if(code === 0) {
				if(data == -1 || data.errcode) {
					callback(1);
				} else {
					callback(0, data);
				}
			}
		})
	}
	
	var getkpimemory = baseUrl + '/app/aplist_fuzzy?';
	v3Apmonitor.getkpimemory = function(devSN, callback) {
		baseRequest.commonPost(getkpimemory + $.param({
			devSN: devSN,
			skipnum: 0,
			limitnum: 1
		}), {
			"findoption": {
				"memoryRatio": {
					"min": 91,
					"max": -1
				}
			},
			"sortoption": {}
		}, 10000, function(code, data) {
			if(code === 2 || code === 1) {
				return callback(2);
			}
			if(code === 0) {
				if(data == -1 || data.errcode) {
					callback(1);
				} else {
					callback(0, data);
				}
			}
		})
	}
	
	var getMindkpiMemory = baseUrl + '/app/aplist_fuzzy?';
	v3Apmonitor.getMindkpimemory = function(devSN, skipnum, callback) {
		baseRequest.commonPost(getMindkpiMemory + $.param({
			devSN: devSN,
			skipnum: skipnum,
			limitnum: 10
		}), {
			"findoption": {
				"memoryRatio": {
					"min": 91,
					"max": -1
				}
			},
			"sortoption": {}
		}, 10000, function(code, data) {
			if(code === 2 || code === 1) {
				return callback(2);
			}
			if(code === 0) {
				if(data == -1 || data.errcode) {
					callback(1);
				} else {
					callback(0, data);
				}
			}
		})
	}
	
	var kpiclient5G = baseUrl + '/aplist_5Gclient?';
	v3Apmonitor.getkpiclient5G = function(devSN, callback){
		baseRequest.commonGet(kpiclient5G + $.param({
			devSN : devSN,
			objNum :51
		}), 10000, function(code, data){
			if(code === 2 || code === 1) {
				return callback(2);
			}
			if(code === 0) {
				if(data == -1 || data.errcode) {
					callback(1);
				} else {
					callback(0, data);
				}
			}
		})
	}
	
	// end
	
	var getApCountByStatus = baseUrl + '/getApCountByStatus?';
	v3Apmonitor.getApCountByStatus = function(devSN, callback){
		baseRequest.commonGet(getApCountByStatus + $.param({
			devSN : devSN
		}), 10000, function(code, data){
			if(code === 2 || code === 1) {
				return callback(2);
			}
			if(code === 0) {
				if(data == -1 || data.errcode) {
					callback(1);
				} else {
					callback(0, data);
				}
			}
		})
	}

	//add by ding
	
	//apStatus= "online","offline"
	v3Apmonitor.getApCountOfApModelByApStatus = function(devSN,apStatus,callback){
		var getApCountOfApModelByApStatusUrl = "";
		if(apStatus === "online"){
			getApCountOfApModelByApStatusUrl = baseUrl + '/getOnlineApCountByModel?';
		}else{
			getApCountOfApModelByApStatusUrl = baseUrl + '/getOfflineApCountByModel?';
		}
		baseRequest.commonGet(getApCountOfApModelByApStatusUrl + $.param({
			devSN : devSN
		}), function(code, data){
			if(code === 2 || code === 1) {
				return callback(2);
			}
			if(code === 0) {
				if(data == -1 || data.errcode) {
					callback(1);
				} else {
					callback(0, data);
				}
			}
		});
	}
	
	//statisticsMode = "cpu" "memery"
	v3Apmonitor.getApStatisticsByMode = function(devSN,statisticsMode,callback){
		var getApStatisticsByModeUrl = "";
		if(statisticsMode === "cpu"){
			getApStatisticsByModeUrl = baseUrl + "/statistics_byapcpuratio?";
		}else{
			getApStatisticsByModeUrl = baseUrl + "/statistics_byapmemratio?";
		}
		baseRequest.commonGet(getApStatisticsByModeUrl + $.param({
			devSN : devSN
		}), function(code, data){
			if(code === 2 || code === 1) {
				return callback(2);
			}
			if(code === 0) {
				if(data == -1 || data.errcode) {
					callback(1);
				} else {
					callback(0, data);
				}
			}
		});
	}
	
	var getApCountByApCreateMethodUrl = baseUrl + "/getApCountByMethod?";
	v3Apmonitor.getApCountByApCreateMethod = function(devSN,callback){
		// {"apList":[{"CreateMethod":1,"ApCount":16},{"CreateMethod":2,"ApCount":0},{"CreateMethod":3,"ApCount":23},{"CreateMethod":4,"ApCount":0}]}
		baseRequest.commonGet(getApCountByApCreateMethodUrl + $.param({
			devSN : devSN
		}), function(code, data){
			if(code === 2 || code === 1) {
				return callback(2);
			}
			if(code === 0) {
				if(data == -1 || data.errcode) {
					callback(1);
				} else {
					callback(0, data);
				}
			}
		});
	}
	
	//apmonitor/app/aplist?devSN=' + AcSN + '&startNum=
	var getApListUrl = baseUrl + '/app/aplist?';
	v3Apmonitor.getApList = function(devSN,startNum,callback){
		baseRequest.commonGet(getApListUrl + $.param({
			devSN : devSN,
			startNum : startNum
		}), function(code, data){
			if(code === 2 || code === 1) {
				return callback(2);
			}
			if(code === 0) {
				if(data == -1 || data.errcode) {
					callback(1);
				} else {
					callback(0, data);
				}
			}
		});
	}
	
	//end
})(mui, window);